package com.anpy.anlibrary.utils

import android.app.Application
import android.content.Context
import com.anpy.anlibrary.BuildConfig
import com.hjq.toast.ToastUtils
import com.orhanobut.logger.AndroidLogAdapter
import com.orhanobut.logger.Logger
import com.tencent.mmkv.MMKV

/**
 * 初始化三方库
 */
object InitUtils {

    fun init(context: Context?) {
        ToastUtils.init(context as Application?)
        MMKV.initialize(context)
        Logger.addLogAdapter(object : AndroidLogAdapter() {
            override fun isLoggable(priority: Int, tag: String?): Boolean {
                return BuildConfig.DEBUG
            }
        })
    }

}